<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <style>
    .item {
      display: flex;
      flex-direction: column;
      align-items: center;
      font-size: 56px;
      border: 2px solid #000;
      width: 400px;
      font-weight: bold;
    }
   
 
  </style>
</head>
<body>
  <script>
  // 三元运算符比较最大值
  var A=4, B=9;
  var reult = (A > B ? 'A >= B': 'A < B');
  document.write(reult);
  document.write('<br>');
 /*  输出【100-999】中的水仙花数
水仙花数是指一个3位数，它的每个位上的数字的3次幂之和等于它本身，例如：1^3+5^3+3^3=153。 */
for (var i = 100; i <= 999; i++) {
  var hunderd = parseInt(i / 100);
  var ten =  parseInt((i % 100) /10);
  var bits =  parseInt(i % 10);
  if (hunderd ** 3 + ten ** 3 + bits ** 3 == i) {
    document.write(hunderd + '^' + '3' + '+' + ten + '^' + '3' + '+' + bits + '^' + '3'+ '=' + i + '<br>');
  }
}
document.write('<br>');
// 打印金字塔
    document.write('<div class="item">');
    for (r=1; r <= 5; r++) {
      document.write('<div class="item-list">');
      for (t = 1; t<=2 * r - 1; t++) {
      document.write("*");
      }
      document.write('</div>');
    }
    document.write('</div>');
     
  </script>

  
</body>
</html>